#ifndef MAINLOGIC_H_
#define MAINLOGIC_H_

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "Temp.h"
/*************************************************************
   CLASS  :  mainLogic
  
   This class is designed to control the thermostat and allow
   for communication between the server and the cooling and 
   heating elements.
   
   functions :
   initSensor - This function will zero out the variables of 
   				the mainlogic class.
   getTemp    - This will be the classes connection to the 
   				sensor and will input the temperature feed. 
   				currently the temp is a pseudorandom number
   getRange   - This function will be given two varibles 
   				in which to put the upper and lowers of the range
   getTime    - This function returns the current time
   setTemp    - This function is given a float for a temp 
   				and determines if the is a valid target for 
   				our thermostat (50 - 90)
   GetTarget  - This function returns the current target 
   heatStatus - This function returns if the heat is on
   heatToggleStatus - This function turns on/off the heat 
   coolStatus - This function returns if the cool is on 
   coolToggleStatus - This function turns on/off the cool

*************************************************************/
class mainLogic
{
private:
	Temp temp;				// 
	bool cool,coolON,heat,heatON,fanON;    	// setting is on or off
	float current;			// current temp
	time_t t;				// 
	//char output[20];			
	
public:
	mainLogic();
	~mainLogic();
    void initSensor();
	float GetTemp();
	void  GetTime(char output[]);
	float GetTarget();
	void  GetRange(float *t1, float *t2);
	bool  SetTemp(float newtemp);
	bool  heatStatus();
	bool  coolStatus();
	bool  heatToggleStatus();
	bool  coolToggleStatus();
	bool  fanStatus();
	bool  fanToggleStatus();
	
};

#endif /*MAINLOGIC_H_*/


